ATSUI functions that draw, highlight, measure, or otherwise operate on text do so to a range of text, not the entire text buffer (unless you specify the entire buffer - see next paragraph). You specify the beginning of this range with an edge offset of type UniCharArrayOffset, and demarcate the end of the range by indicating a length of type UniCharCount.
If you want the range to start at the beginning of the text buffer, you should pass the constant kATSUFromTextBeginning. If you want the range to span the entire text buffer, pass kATSUFromTextBeginning in conjunction with the constant kATSUToTextEnd, described in Text Length Constant. This constant is available with ATSUI 1.0 and later.
enum {
kATSUFromTextBeginning = (long)0xFFFFFFFF,
};
Constant descriptions
kATSUFromTextBeginning
Indicates that the range of text to be operated on should start at the beginning of the text layout object's text buffer.